<include file="public@header" />
</head>
<body>
<style type="text/css">
	.aui_state_lock{
		top:50% !important;
		left: 50% !important;
		transform: translate(-50%,-50%);
	}
	.gray{
		 background-color:gray;
	}
	p{ line-height:23.33px} 
</style>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="" id="list"><a href="{:url('Wxmeeting/index',array('wx_secrect'=>session('wx_secrect')))}">预约列表</a></li>
			<li class="active" id="list"><a href="{:url('Wxmeeting/meeting_detail',array('wx_secrect'=>session('wx_secrect')))}">预约详情</a></li>
		<!-- 	<li><a href="{:url('order/addorder')}">添加</a></li> -->
			<!-- 	<li><a href="{:url('user/add')}">{:lang('ADMIN_USER_ADD')}</a></li> -->
		</ul>
		<form class="well form-inline margin-top-20" method="post" action="{:url('Wxmeeting/meeting_detail')}">
		 预约时间:
		<!-- 	<input type="text" class="form-control" name="staff_name" style="width: 140px;" value="{:session('staff_name')}" placeholder="请输入员工名称"> -->
		<?php $num=array(0,1,2,3,4,5,6); ?>
		<select class="form-control" name="num" style="width: 140px;">
				<option value='0'>请选择日期</option>
					<volist name="num" id="vo">
				   <option value="{$vo+1}">{:date("m-d",strtotime("+$vo day",time()))}</option>
			</volist>
			</select> 
			<!-- 业务员名称:
			<input type="text" class="form-control" name="salesname" style="width: 140px;" value="" placeholder="请输入业务员名称"> -->
			<!-- 企业名称:
			<input type="text" class="form-control" name="commpany_name" style="width: 140px;" value="" placeholder="请输入业务员名称"> -->
		<!-- 	场地名称:
			<input type="text" class="form-control" name="site_name" style="width: 140px;" value="{:session('site_name')}" placeholder="请输入客户名称"> -->
			<!-- <br/><br/>
			时间:
			<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
			value="{$start_time|default=''}"
			style="width: 140px;" autocomplete="off">-
			<input type="text" class="form-control js-bootstrap-datetime" name="end_time"
			value="{$end_time|default=''}"
			style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;  -->
			
		<!-- 	时间:
			<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
			value="{:session('start_time')}"
			style="width: 140px;" autocomplete="off">-
			<input type="text" class="form-control js-bootstrap-datetime" name="end_time"
			value="{:session('end_time')}"
			style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;  -->


			<input type="button" class="btn btn-primary get_list" value="搜索" />
			<a class="btn btn-danger" href="{:url('Wxmeeting/meeting_detail')}">清空</a>
		</form>
		<div class="list">
<!-- 			<div style="float: left">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;" value="会议室" placeholder="请输入员工名称" readonly="readonly">
			<p style='border-top:1px solid #f00;'>8:00</p>

			<p style='border-top:1px solid #f00;'>8:30</p>
			<p style='border-top:1px solid #f00;'>9:00</p>
			<p style='border-top:1px solid #f00;'>9:30</p>
			<p style='border-top:1px solid #f00;'>10:00</p>
			<p style='border-top:1px solid #f00;'>10:30</p>

			<p style='border-top:1px solid #f00;'>11:00</p>
			<p style='border-top:1px solid #f00;'>11:30</p>
			<p style='border-top:1px solid #f00;'>12:00</p>
			<p style='border-top:1px solid #f00;'>12:30</p>
			<p style='border-top:1px solid #f00;'>13:00</p>
			<p style='border-top:1px solid #f00;'>13:30</p>
			<p style='border-top:1px solid #f00;'>14:00</p>
			<p style='border-top:1px solid #f00;'>14:30</p>
			<p style='border-top:1px solid #f00;'>15:00</p>
			<p style='border-top:1px solid #f00;'>15:30</p>
			<p style='border-top:1px solid #f00;'>16:00</p>
			<p style='border-top:1px solid #f00;'>16:30</p>

			<p style='border-top:1px solid #f00;'>17:00</p>
			<p style='border-top:1px solid #f00;'>17:30</p>

			<p style='border-top:1px solid #f00;'>18:00</p>
			<p style='border-top:1px solid #f00;'>18:30</p>

			<p style='border-top:1px solid #f00;'>19:00</p>
			<p style='border-top:1px solid #f00;'>19:30</p>
			<p style='border-top:1px solid #f00;'>20:00</p>
			
		</div> -->
			<div style="float: left">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;" value="会议室" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="8:00" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="8:30" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="9:00" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="9:30" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="10:00" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="10:30" placeholder="请输入员工名称" readonly="readonly">

			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="11:00" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="11:30" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="12:00" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="12:30" placeholder="请输入员工名称" readonly="readonly">

			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="13:00" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="13:30" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="14:00" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="14:30" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="15:00" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="15:30" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="16:00" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="16:30" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="17:00" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="17:30" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="18:00" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="18:30" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="19:00" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;background-color: white" value="19:30" placeholder="请输入员工名称" readonly="readonly">
			<input type="text" class="form-control" name="staff_name" style="width: 110px;border-top:1px ;border-left:1px solid white;
			border-right:1px solid white;border-bottom:1px solid white;background-color: white" value="20:00" placeholder="请输入员工名称" readonly="readonly">
			</div>

        </div>

		
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
<script>
	$(function(){
		stime="1";
		etime="2";
		cusname="1";
		spacname="2";
		commpany_name="3";
		salesman="2";
		if(spacname){
			$("input[name=space_name]").val(spacname);
		}
		if(salesman){
			$("input[name=salesname").val(salesman);
		}
		// if(cusname){
		// 	$("input[name=customer_name]").val(cusname);
		// }
		//alert(commpany_name);
		if(commpany_name){
			$("input[name=commpany_name]").val(commpany_name);
		}
		// if(stime){
		// 	$("input[name=start_time]").val(stime);
		// }
		// if(etime){
		// 	$("input[name=end_time]").val(etime);
		// }
	})
	$(".add_audit").click(function(){
		id=$(this).attr("id");
			if(confirm("是否通过审核？")){
				 $.post("{:url('Wxmeeting/add_audit')}",{id:id,cancel:1},function(data,status){
				 
				 	alert('审核成功');	
				 	//$("input[name=deposit_price]").val('0.00');
				 	location.href="{:url('index')}";
				 })
			}
		
		   })	
	$(".add_cancel_audit").click(function(){
		id=$(this).attr("id");
			if(confirm("是否确定此审核不通过？")){
				 $.post("{:url('Wxmeeting/add_audit')}",{id:id,cancel:2},function(data,status){
				
				 	alert('禁止通过成功');	
				 	//$("input[name=deposit_price]").val('0.00');
				 	location.href="{:url('index')}";
				 })
			}
		
		   })	
	$(".del").click(
	    function(){
	    if(confirm("确认要禁用吗")){
	    	    var id=$(this).attr("id");
	    	    $.post("{:url('forbade_staff')}",
	    		{id:id,cancel:1},
	    		function(data,status){

	    			location.href="{:url('index')}";
	    		});
	    }
		
		
	    }
	);
	$(".cancel_del").click(
	    function(){
	    if(confirm("确认要取消禁用吗")){
	    	    var id=$(this).attr("id");
	    	    $.post("{:url('forbade_staff')}",
	    		{id:id,cancel:2},
	    		function(data,status){

	    			location.href="{:url('index')}";
	    		});
	    }
		
		
	    }
	);
   var num='';
   get_list(num);
   function get_list(num){
   	$(".append").remove();
   	if(num==''){
   		num=1;
   	}
   	var  c =  "<div class='append' style='float : left'>" ;
   $.ajaxSettings.async = false;
   	$.post("{:url('Wxsite/index')}",{num:num},function(data,status){

   		$.each(data,function(i,j){
   			var a ='';
			// alert(j.apply.length);
			var len= j.apply.length-1;
			j.apply.splice(len,1);
			j.apply.splice(j.apply.length-1,1);

			a +=   "<input type='text' class='form-control' name='staff_name' style='width: 110px;'  value='"+j.site_name+"' readonly='readonly'>" ;
			$.each(j.apply,function(e,f){

				//  console.log(f);

				if(f.selected==3){

					a +=   "<input type='text' class='form-control' name='staff_names' style='width: 110px;background-color:	#53FF53'  value='' readonly='readonly'>" ;

				}

				else if(f.selected==1){
					a +=   "<input type='text' class='form-control' name='staff_name' style='width: 110px; ' value='' readonly='readonly'>" ;
				}
				else if(f.selected==2){
					a +=   "<input type='text' class='form-control' name='staff_name' style='width: 110px; background-color:#FF5151	' value='"+f.staff_name+"' readonly='readonly'>" ;
				}
				else if(f.last==1){
					a +=   "<input type='text' class='form-control' name='staff_name' style='width: 110px; background-color:#FF5151	' value='"+f.staff_name+"' readonly='readonly'>" ;
				}
				
			})
			b =  "</div>";
			var e=c+a+b;
			$(".list").append(e);
		})


   	})
  //  	$(".list div").each(function(i,j){
	  
	 //  	var att=$(this).find("input[name='staff_names']");
	  
	 //  var len=att.length;
	 //  var i=1;
	
	 // $.each(att,function(e,j){
	 // 	if(len==i){
	 // 		$(this).css("background-color","");
	  	
	 //  	}
	 //  	console.log(j);
	 //  	i++;
	 //  })

	 //  })
   }
   $(".get_list").click(function(){
   	num=$("select[name=num]").val();
   	get_list(num);
   })

</script>